export default {
    namespaced: true,
    state: {
        isShowToast: false,
        toastMsg: "默认值",
        toastType: "success"
    },
    mutations: {
        changeIsShowToast(state, payload) {
            state.isShowToast = payload.isshow
            if (payload.isshow) {
                state.toastType = payload.type
                state.toastMsg = payload.msg
            }
        },

    },
    actions: {
        asyncchangeIsShowToast({ commit }, payload) {
            console.log(123);
            commit("changeIsShowToast", payload)
            setTimeout(() => {
                commit("changeIsShowToast", {
                    isshow: false
                })
            }, 2000)
        }
    }
}